<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ include file="/WEB-INF/jsp/struts/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" href="style/home.css" type="text/css">
<link href="./style/alternative.css" media="all" rel="stylesheet" />
<script type='text/javascript' src='script/prototype.js'></script>
<script type='text/javascript' src='script/common.js'></script>
<script type="text/javascript">
  _editor_url = "./htmlarea";
  _editor_lang = "en";
</script>
<script type="text/javascript" src="./htmlarea/htmlarea.js"></script>
<STYLE TYPE="text/css">
#articleTab {
border: 2px broove #eee;
padding-top: 1em;
}
#articleTab td{
padding:0.2em;
white-space:nowrap;
}
#articleTab a{
font-size:1em;color:#330099
}
</STYLE>

</head>
<body onload="HTMLArea.init();">
<c:choose>
<c:when test="${empty article}">
<c:set var="handler" value="article.htm?method=create" />
</c:when>
<c:otherwise>
<c:set var="handler" value="article.htm?method=update" />
</c:otherwise>
</c:choose>
<div id="content">
<div id="content_inner">
<form name="articleForm" id="articleForm" action="${handler}"  method="post">
<TABLE id="articleTab" class="its" width="95%">
<thead>
<tr><th colspan="2" align="center">我的笔记</th></tr>
  </thead>
  <TR>
    <TD width="10%">标题:</TD>
    <TD>
    <input type="text" NAME="topic" id="topic" style="width:100%" value="${article.topic}"/>
    </TD>
  </TR>
  <TR>
   
    <TD colspan="2">
    <textarea id="articleContent" name="content" style="width:100%" ROWS="16" COLS="70">${article.content}</TEXTAREA>
    </TD>
  </TR>
  <TR>
    <TD>关键字:</TD>
    <TD>
    <input type="text" NAME="keywords" id="keywords" style="width:100%"  value="${article.keywords}"/>
    </TD>
  </TR>
  <TR>
    <TD>类别: </TD>
    <TD><SELECT NAME="categoryID" ID="categoryID">
<c:forEach items="${categories}" var="entry">
        <OPTION VALUE="${entry.key}">${entry.value.description}
 </c:forEach>
</SELECT></TD>
  </TR>
  <TR>
    <TD colspan="2" align="center">
    <input type="hidden" name="articleID" id="articleID" value="${article.articleID}">
    <INPUT TYPE="submit" value="确认">&nbsp;&nbsp;
    <INPUT TYPE="reset" value="取消" onclick="javascript:history.back()"></TD>
  </TR>
  </TABLE>
</FORM>
<script language="Javascript">
<c:if test="${not empty article}">
var pid = "" + "${article.categoryID}";
toSelect("categoryID",pid);

</c:if>


HTMLArea.loadPlugin("ContextMenu");
HTMLArea.onload = function() {
    var editor = new HTMLArea("articleContent");
    editor.registerPlugin(ContextMenu);
    editor.generate();
};
HTMLArea.init();
</script>

</div></div>
</body>
</html>